package com.zpark.jsoup;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.io.File;
import java.io.IOException;

/**
 * @PackageName: com.zpark.jsoup
 * @ClassName: Demo10
 * @Description:
 * @author: RZS
 * @date: 2021/8/16  0:14
 */
public class Demo10 {
    public static void main(String[] args) throws IOException {
        Document document = Jsoup.connect("https://y.qq.com").get();
        Elements elements = document.select("a[href]");
        Elements attr = elements.attr("href", "DC");
        for (Element element : attr) {
            Elements a = element.getElementsByTag("a");
            for (Element element1 : a) {
                System.out.println(element1.attr("href"));
            }

        }
    }
}
